package com.ctgu.chatapp.view.adapter

import android.net.Uri
import android.widget.ImageView
import coil.load
import com.mx.imgpicker.factory.IMXImageLoader
import com.mx.imgpicker.models.Item
import com.mx.imgpicker.models.MXPickerType
import java.io.File

class CoilImageLoader : IMXImageLoader {
    override fun displayImage(item: Item, imageView: ImageView) {
        if (item.type == MXPickerType.Image)
            imageView.load(item.uri)
        else
            imageView.load(Uri.fromFile(File(item.path)))
    }

}